<?php
namespace app\api\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\menus\validate
 * @author
 */
class Order extends Validate
{
    //定义验证规则
    protected $rule = [
        'room_id|房间'  => 'require',
        'hand_card_id|手牌'  => 'require',
        'total_num|总数量'  => 'require',
        'total_price|总价格' =>'require',
        'order_type|订单类型' =>'require',
        'delay|延迟时间' =>'require',
        'time_type|下单规则' =>'require',
        'project|项目' =>'require',
    ];
    //定义验证提示
    protected $message = [
        'room_id.require' => '房间必须填写',
        'hand_card_id.require' => '请选择下单人',
        'total_num.require' => '总数量必须填写',
        'total_price.require' => '总价格必须填写',
        'order_type.require' => '订单类型必须填写',
        'delay.require' => '延迟时间必须填写',
        'time_type.require' => '下单规则必须填写',
        'project.require' => '项目必须填写',
    ];
    //定义验证场景
    protected $scene = [
        'add'   =>  ['room_id','hand_card_id','total_num','total_price','order_type','delay','time_type','project'],
        'seckill'   =>  ['goods_data','is_point'],
        'yu_pay'   =>  ['id','pay_type','money','yu_deduction','safeword'],
        'pay'   =>  ['id','pay_type','money'],
    ];
}
